package com.lzy.cloud.mq.service;

import com.lzy.framework.core.output.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;


/**
 * Created with IntelliJ IDEA.
 * Description: lzy-cloud-service
 *
 * @author: ellengou
 * @date: 2018-07-18 星期三
 * @time: 11:50
 */
@Component
@Slf4j
public class XXXReceiver {

    @RabbitHandler
    @RabbitListener(queues = "test.payment")
    @SendTo( "test.payment")
    public String receive(String msg) {
        log.info("test.payment receive message: "+msg);
        if(msg.equals("123")){
            log.info("msg是123");
            return "true";
        }else{
            log.info("msg不是123");
            return "false";
        }
    }

}
